#include <iostream>
using namespace std;

long fib(int n) {
  int f0 = 0, f1 = 1, currentFib;

  if (n == 0) return 0;
  if (n == 1) return 1;

  for (int i = 1; i <= n; i++) {
    currentFib = f0+f1;
    f0 = f1;
    f1 = currentFib;
  }

  return f1;
}

int main()
{
  cout << "The fibonacci(10) is " << fib(10) << endl;

  return 0;
}
